package com.vitaf.cash.app.sdk.dec.util

import android.content.Context
import com.vitaf.cash.app.sdk.dec.util.GombeCreditUserDecUtils.takeZipString
import org.json.JSONObject

/**
 * storage
 */
class GombeCreditUserDec4(val context: Context) {

    fun takeUserDec4Data(): String? {
        return try {
            val data = JSONObject().apply {
                put("imei", "")
                put("containSd", GombeCreditUserDecUtils.takeDec4Params7())
                put("ramCanUse", GombeCreditUserDecUtils.takeDec4Params3(context))
                put("ramTotal", GombeCreditUserDecUtils.takeDec1AndDec4Params1(context))
                put("cashCanUse", GombeCreditUserDecUtils.takeDec4Params5())
                put("cashTotal", GombeCreditUserDecUtils.takeDec1AndDec4Params2())
                put("extraSD", GombeCreditUserDecUtils.takeDec4Params8())
                put("internalTotal", GombeCreditUserDecUtils.takeDec4Params1(context))
                put("internalAvailable", GombeCreditUserDecUtils.takeDec4Params2(context))
                put("ramDidUsed", GombeCreditUserDecUtils.takeDec4Params4(context))
                put("cashDidUsed", GombeCreditUserDecUtils.takeDec4Params6())
                put("sdCardTotal", GombeCreditUserDecUtils.takeDec4Params9())
            }
            data.toString().takeZipString()

        } catch (e: Exception) {
            null
        }
    }
}